﻿using BusinessObjects;
using BusinessObjects.BusinessRules;

namespace BusinessSecurity
{
    /// <summary>
    ///     RoleInSite
    /// </summary>
    public class RoleInSite : BusinessObject
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="RoleInSite" /> class.
        /// </summary>
        public RoleInSite()
        {
            AddRule(new ValidateId("RoleId"));
            AddRule(new ValidateId("PermissionId"));
            AddRule(new ValidateId("SiteId"));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RoleInSite" /> class.
        /// </summary>
        /// <param name="roleId">The role identifier.</param>
        /// <param name="siteId">The site identifier.</param>
        /// <param name="permissionId">The permission identifier.</param>
        public RoleInSite(int roleId, int siteId, int permissionId)
        {            
            RoleId = roleId;
            SiteId = siteId;
            PermissionId = permissionId;
        }        

        /// <summary>
        ///     Gets or sets the role identifier.
        /// </summary>
        /// <value>
        ///     The role identifier.
        /// </value>
        public int RoleId { get; set; }

        /// <summary>
        ///     Gets or sets the permission identifier.
        /// </summary>
        /// <value>
        ///     The permission identifier.
        /// </value>
        public int PermissionId { get; set; }

        /// <summary>
        ///     Gets or sets the site identifier.
        /// </summary>
        /// <value>
        ///     The site identifier.
        /// </value>
        public int SiteId { get; set; }
    }
}